[#import "/framework/JGP.htm"  as JGP]
<!--
项目   jgp-cloud-parent
作者   LOUFEI [Gavin]
时间   2018/12/3
-->
[@JGP.head "流程"/]
[@JGP.body]
    <jgp-grid slot="2-1" _id="modelGrid" _url="/workflow/processApiController/queryProcessDef"
              _record_tools="[{'icon':'edit','tip':'启动流程','fn':'startProcess'},
                  {'icon':'edit','tip':'查看流程图','fn':'showProcessPicBeforeStart'}]">
    </jgp-grid>
[/@JGP.body]

[@JGP.foot]
    <script>
        function showProcessPicBeforeStart(data){
            var defKey = data.back.record.defKey;
            var config = {
                url:'/workflow/processController/showProcessPicBeforeStart/'+defKey
            };
            JGP.$dialog(config);
        }

        function startProcess(data){
            JGP.$post('/workflow/processApiController/start',{
                userId:'${userId!'null'}',
                defKey:data.back.record.defKey,
                businessKey:new Date().getTime(),
                jsonVariables:JSON.stringify({
                    orderContent:'工单内容'
                })
            })
        }
    </script>
[/@JGP.foot]